On ARM, when an initrd is given to xen by U-boot, it will reserve the memory
in the device tree.
In this case, when xen decides to free unused memory, dt_unreserved_regions
will call init_domheap_pages with the start and the end of range equals. But
the latter assumes that (start > end), if not Xen will hang because the
number of pages is equals to (unsigned)-1.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Campbell <Ian.campbell@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
smfn = round_pgup(ps) >> PAGE_SHIFT;
emfn = round_pgdown(pe) >> PAGE_SHIFT;
+ if ( emfn <= smfn )
+ return;
+
init_heap_pages(mfn_to_page(smfn), emfn - smfn);
}